<script setup lang="ts">
import { getVersion } from '@tauri-apps/api/app';
import { onMounted, ref } from 'vue';

defineProps<{
  statusInfo: string;
}>();

onMounted(async () => {
  version.value = await getVersion();
});

const version = ref<string>();
</script>

<template>
  <footer>
    <span class="status-info">{{ statusInfo }}</span>
    <span class="tauri-info">v{{ version }} Powered by Tauri © 2025 HuiW</span>
  </footer>
</template>

<style scoped>
footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  color: gray;
  font-size: 0.8rem;
  background-color: #efefef;
}

.status-info {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tauri-info {
  min-width: 210px;
  text-align: right;
}
</style>
